<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title></title>
    </head>
    <body>
        <script type="text/javascript">
           //localStorage
           //存数据
            localStorage.title = "前端快速入门";
            localStorage["author"] = "黑马";
            localStorage.setItem("content","黑马程序员-现已全国开设20所分校,直营分校已遍布一线城市及省会城市,服务30余万学员,包括JavaEE,Python,人工智能,HTML&JS+前端,大数据,UI/UE设计等10余个学科培训.")
            //取数据
            document.write("<h1>"+localStorage.title+"</h1>");
            document.write("<h2>"+localStorage["author"]+"</h2>");
            document.write("<p>"+localStorage.getItem("content")+"</p>")
            //清除数据
            //localStorage.clear();
            localStorage.removeItem("author");
            console.log(localStorage);
            //sessionStorage功能和localStorage相似
        </script>
    </body>
</html>